﻿using System;
using UnityEngine;
using UnityEngine.UI;
using Utils;

public class ToggleExtra : MonoBehaviour
{
    public GameObject On;
    public GameObject Off;
    private Toggle toggle;

    private void Awake()
    {
        toggle = GetComponent<Toggle>();
        On = UITool.GetChildGameObject("On", gameObject);
        Off = UITool.GetChildGameObject("Off", gameObject);
        ToggleClick(toggle.isOn);
    }

    public void ToggleClick(bool state)
    {
        On.SetActive(state);
        Off.SetActive(!state);
    }
}